#!/bin/bash
#    squirrelvoice.bash - A simple bash script with sox.
#    Copyright (C) 2015  zorro@inventati.org
#
#    This program is free software: you can redistribute it and/or modify
#    it under the terms of the GNU General Public License as published by
#    the Free Software Foundation, either version 3 of the License, or
#    (at your option) any later version.
#
#    This program is distributed in the hope that it will be useful,
#    but WITHOUT ANY WARRANTY; without even the implied warranty of
#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#    GNU General Public License for more details.
#
#    You should have received a copy of the GNU General Public License
#    along with this program.  If not, see http://www.gnu.org/licenses/ .
#
# Options:
# You can make pulseaudio load the null-sink automatically, if you edit the /etc/pulse/default.pa file and add 
# the following line to the end of that file: "load-module module-null-sink" and comment the next line
pactl load-module module-null-sink

if [[ -z $1 ]] ; then
	echo "$0 Select voice: Add -s to be a Squirrel or -b for Bigman."
	exit 1
fi

if [[ "$1" == "-s" ]] ; then
	sox -t pulseaudio default -t pulseaudio null pitch +500 | pavucontrol
elif [[ "$1" == "-b" ]] ; then
	sox -t pulseaudio default -t pulseaudio null pitch -800 | pavucontrol
else
	echo "$0 Select voice: Add -s to be a Squirrel or -b for Bigman." >&2
	exit 1
fi
